import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), UnoCSS()],
  build: {
    chunkSizeWarningLimit: 1000,
    rollupOptions: {
      output: {
        manualChunks: {
          // 将大型依赖单独分块
          'vue-vendor': ['vue', 'vue-router'],
          'element-plus': ['element-plus'],
          'pinia-vendor': ['pinia', 'pinia-plugin-persistedstate'],
          'utils-vendor': ['axios', 'file-saver', '@vueuse/core']
        }
      }
    }
  }
})
